package com.accloud.service;

public class QueryOption {
    public static final int DEFAULT_LIMIT = 20;
    public static final int MAX_LIMIT = 1000;
    private Criteria criteria;
    private long endTime;
    private int limit;
    private String[] projection;
    private long startTime;

    public QueryOption() {
    }

    public QueryOption(Criteria criteria2) {
        this.criteria = criteria2;
    }

    public QueryOption projection(String[] projection2) {
        this.projection = projection2;
        return this;
    }

    public QueryOption startTime(long startTime2) {
        this.startTime = startTime2;
        return this;
    }

    public QueryOption endTime(long endTime2) {
        this.endTime = endTime2;
        return this;
    }

    public QueryOption limit(int limit2) {
        this.limit = limit2 > 0 ? Math.min(limit2, 1000) : 20;
        return this;
    }

    public Criteria getCriteria() {
        return this.criteria;
    }

    public String[] getProjection() {
        return this.projection;
    }

    public long getStartTime() {
        return this.startTime;
    }

    public long getEndTime() {
        return this.endTime;
    }

    public int getLimit() {
        return this.limit;
    }
}
